package com.zh.yqbj.controller;

import cn.dev33.satoken.util.SaResult;
import com.zh.yqbj.VO.UserVO;
import com.zh.yqbj.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;


    /**
     * 获取当前登录用户信息
     *
     * @return userInfo
     */
    @GetMapping
    public SaResult getLoginUserInfo() {
        UserVO userInfo = userService.getLoginUserInfo();
        return new SaResult(200, null, userInfo);
    }

}
